<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title></title>
[#import "/admin/include/admin_pagination.ftl" as p/]
[#include "/admin/include/admin_static.htm"]
<script>
	$(function() {
		$("#export") .click( function() {
			$("#searchForm").attr("action", "${path }/admin/borrow/exportBorrowList.aspx?status=6").submit();
		});
	});
</script>
</head>
<body>
	<div class="main_admin_content">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>已完结</legend>
        </fieldset>
        <form id="searchForm" method="post">
            <table class="search_table_div">
                <tr>
                    <td class="column">项目类型：</td>
                    <td>
					[@u.select listKey="id"  headerKey="" headerValue="全部类型" listValue="category_name" headerButtom="false" list=LoanCategoryUtils.getLoanCategoryList()
					name="loanCategory" value="${(loanCategory)!''}" /]
                    </td>
                    <td class="column">用户ID：</td>
                    <td><input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" class="layui-input" name="memberId" value="${memberId }" /></td>
                    <td class="column">用户名：</td>
                    <td><input type="text" name="memberName" value="${memberName }" /></td>
                </tr>
                <tr>
                    <td class="column">项目ID：</td>
                    <td><input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" class="layui-input" name="loanId" value="${loanId }" /></td>
                    <td class="column">日期：</td>
                    <td>
                        <input type="text" onclick="WdatePicker();" value="${begin_date }"
                               name="begin_date" readonly="readonly" class="layui-icon" >

                        </input>
                        <i>至</i>
                        <input type="text" onclick="WdatePicker();" value="${end_date }"
                               name="end_date" readonly="readonly" class="layui-icon" />
                    </td>
                </tr>
                <tr>
                    <th colspan="100" class="btn_td">
                        <input id="export" type="button" class="layui-btn" style="float:left;width: 100px; heigth: 30px; line-height: 30px" value="导出">
                        <input id="query" type="button" class="layui-btn" value="查询"/>
                        <input onclick="resent();" type="button" class="layui-btn" value="清空"/>
                    </th>
                </tr>
            </table>
        </form>
        <table class="layui-table">
            <colgroup>

                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">

            </colgroup>
            <thead>
			<tr>
				<th>项目类型</th>
				<th>用户ID</th>
				<th>用户名称</th>
				<th>项目ID</th>
				<th>项目名</th>
				<th>借款金额</th>
				<th>借款期限</th>
				<th>年化收益率</th>
				<th>完结时间</th>
				<th>还款方式</th>
				<th>应还金额</th>
				<th>已还金额</th>
				<th>投标记录</th>
                <th>还款记录</th>
			</tr>
            </thead>
            <tbody>
[#list loans as loan]

				<tr>
					<td>${loan.category_name }</td>
					<td>${loan.user_id}</td>
					<td>
							${loan.u_user_name}</td>
					<td>${loan.id }</td>
					<td>${loan.name }</td>

					<td>￥${loan.account}</td>
					<td>${loan.time_limit }${(loan.is_day==1)?string("天","个月") }</td>
					<td>${loan.apr }%</td>
					<td>

						${p2p_date_format(loan.finish_time ,"yyyy-MM-dd HH:mm:ss")}

					</td>
					<td>
					${p2p_get_dict("borrow_style",loan.pay_style)}
					</td>
					<td>￥${loan.repayment_account}</td>
					<td>￥${loan.repayment_yesaccount}</td>
					<td>
						<input type="button" value="还款明细"
						onclick="window.location.href='${path }/admin/repayment/list.aspx?borrowId=${loan.id}'"
                               class="layui-btn "/>
                    </td>
                    <td>
						<input type="button" value="投标记录"
						onclick="window.location.href='${path}/admin/tender/tenderLog${loan.id}.aspx'"
                               class="layui-btn "/></td>
				</tr>
[/#list]
            </tbody>
		</table>
	[@p.pager pager = page parameterMap={"loanCategory":"${loanCategory }","memberId":"${memberId }","memberName":"${memberName }","begin_date":"${begin_date }","end_date":"${end_date }"}   url = "${path}/admin/borrow/borrowList.aspx?status=6"/]
	</div>
</body>
</html>